!function () {
    "use strict";
    var $$ = Dom7;
    $$.ajax({
        url: 'http://api.nldou.com/weixinapi/init_wx_jsapi',
        method: "GET",
        data: {fromUrl: window.location.href},
        dataType: 'json',
        success: function (res) {
            if (res.code == 1) {
                wx.config({
                    debug: false,
                    appId: res.data.appid,
                    timestamp: res.data.timestamp,
                    nonceStr: res.data.nonceStr,
                    signature: res.data.signature,
                    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','hideMenuItems']
                });
            }
        }
    });
    wx.ready(function () {
        wx.hideMenuItems({
            menuList: ['menuItem:copyUrl','menuItem:openWithQQBrowser','menuItem:openWithSafari']
        });
        wx.onMenuShareTimeline({
            title: '能量逗团购优惠券',
            link: 'http://wap.nldou.com/coupon2/index.html',
            imgUrl: 'http://wap.nldou.com/coupon2/img/share-bg.jpg',
            success: function () {
                return true;
            },
            cancel: function () {
                return true;
            }
        });
        wx.onMenuShareAppMessage({
            title: '能量逗团购优惠券',
            desc: '快来领取能量逗卡牌优惠券吧~~',
            link: 'http://wap.nldou.com/coupon2/index.html',
            imgUrl: 'http://wap.nldou.com/coupon2/img/share-bg.jpg',
            type: 'link',
            success: function () {
                return true;
            },
            cancel: function () {
                return true;
            }
        });
        wx.onMenuShareQQ({
            title: '能量逗团购优惠券',
            desc: '快来领取能量逗卡牌优惠券吧~~',
            link: 'http://wap.nldou.com/coupon2/index.html',
            imgUrl: 'http://wap.nldou.com/coupon2/img/share-bg.jpg',
            success: function () {
                return true;
            },
            cancel: function () {
                return true;
            }
        });
        wx.onMenuShareWeibo({
            title: '能量逗团购优惠券',
            desc: '快来领取能量逗卡牌优惠券吧~~',
            link: 'http://wap.nldou.com/coupon2/index.html',
            imgUrl: 'http://wap.nldou.com/coupon2/img/share-bg.jpg',
            success: function () {
                return true;
            },
            cancel: function () {
                return true;
            }
        });
        wx.onMenuShareQZone({
            title: '能量逗团购优惠券',
            desc: '快来领取能量逗卡牌优惠券吧~~',
            link: 'http://wap.nldou.com/coupon2/index.html',
            imgUrl: 'http://wap.nldou.com/coupon2/img/share-bg.jpg',
            success: function () {
                return true;
            },
            cancel: function () {
                return true;
            }
        });
    });
}();
